'''
Created on May 18, 2011

@author: Adam Matysiak
'''
from tfct.fuse import model

class ListFuse:
    def __init__(self):
        self.manager = model.FUSE({'screenspec': {}})
        
    def genUC1(self):        
        usecase = self.manager.add_usecase("Logging to the system", "Subfunction")
        usecase.add_step("User goes to the log in form", "LoginView")
        usecase.add_step("System shows start page")
        usecase.add_step("User enter login and password")
        usecase.add_step("System verifies data")
        usecase.add_step("System redirects to view depending on his profile", "StudentView")
        extension = usecase.add_exception(3, "Login and password does not match.")
        extension.add_step("Display proper information")
        extension.add_step("Go to 2.")
        return usecase
    
    def genUC2(self):
        usecase = self.manager.add_usecase("Provide a report", "Subfunction")
        usecase.add_step("Student loads initial report form", "StudentView")
        usecase.add_step("System presents a form for report submission", "ReportNew")
        usecase.add_step("Student provides report data")
        usecase.add_step("System validates a data")
        usecase.add_step("System stores a report")
        usecase.add_step("System shows list of submitted reports", "ReportView")
        extension = usecase.add_exception(4, "Provided data is incomplete")
        extension.add_step("Go to 2")
        extension = usecase.add_exception(4, "All reports were provided")
        extension.add_step("Go to 6")
        extension = usecase.add_exception(5, "All reports were provided")
        extension.add_step("Go to 6")
        return usecase
    
    def genUC3(self):
        usecase = self.manager.add_usecase("Provide a report", "User")
        usecase.add_step("Student loads initial report form", "StudentView")        
        usecase.add_step("System presents a form for report submission", "ReportNew")
        usecase.add_step("Student provides report data")
        usecase.add_step("System validates a data")
        usecase.add_step("System stores a report")
        usecase.add_step("System shows list of submitted reports", "ReportView")
        extension = usecase.add_exception(4, "Provided data is incomplete")
        extension.add_step("Go to 3")
        extension = usecase.add_exception(4, "All reports were provided")
        extension.add_step("Go to 6")
        return usecase
    
    def genUC4(self):
        usecase = self.manager.add_usecase("View a report", "User")
        usecase.add_step("Student loads report view", "StudentView")        
        usecase.add_step("System shows the report view with list of available reports", "ReportView")        
        usecase.add_step("Student chooses report for detailed description")        
        usecase.add_step("System show details of chosen report", "ReportDetails")        
        return usecase
    
    def genUC5(self):
        usecase = self.manager.add_usecase("Submit a problem", "User")
        usecase.add_step("Student loads a submit problem view", "StudentView")        
        usecase.add_step("System shows a submit problem view", "ProblemNew")    
        usecase.add_step("Student provides details about a problem")    
        usecase.add_step("System validates data")    
        usecase.add_step("System stores provided data", "ProblemView")    
        extension = usecase.add_exception(4, "Provided data is incomplete")
        extension.add_step("Go to 3")
        return usecase
    
    def genUC6(self):
        usecase = self.manager.add_usecase("View a problem", "User")
        usecase.add_step("Student loads a problem view", "StudentView")        
        usecase.add_step("System shows a problem view with list of problems", "ProblemView")        
        usecase.add_step("Student chooses selected problem")        
        usecase.add_step("System presents details about selected problem", "ProblemDetails")        
        return usecase
    
    def genUC7(self):
        usecase = self.manager.add_usecase("View personal data", "User")
        usecase.add_step("Student loads a personal data view", "StudentView")        
        usecase.add_step("System shows a personal data view", "PersonalDataView")        
        usecase.add_step("Student browse personal data")        
        return usecase
    
    def genUC8(self):
        usecase = self.manager.add_usecase("Update personal data", "User")
        usecase.add_step("Student loads a personal data view", "StudetView")        
        usecase.add_step("System shows a personal data view", "PersonalDataView")        
        usecase.add_step("Student modifies persona data")        
        usecase.add_step("System validates provided data")        
        usecase.add_step("System stores provided data")        
        usecase.add_step("System presents modified data", "PersonalDataView")
        extension = usecase.add_exception(4, "Provided data is incomplete")
        extension.add_step("Go to 3")        
        return usecase
        
    def getUC1(self):
        return '''UC1: Logging to the system
Level: Subfunction
Main scenario:
1. User goes to the log in form [LoginView]
2. System shows start page
3. User enter login and password
4. System verifies data
5. System redirects to view depending on his profile [StudentView]
Exceptions:
3a. Login and password does not match.
3a1. Display proper information
3a2. Go to 2.
'''    
        
    def getUC2(self):
        return '''UC2: Provide a report
Level: Subfunction
Main scenario:
1. Student loads initial report form [StudentView]
2. System presents a form for report submission [ReportNew]
3. Student provides report data
4. System validates a data
5. System stores a report
6. System shows list of submitted reports [ReportView]
Exceptions:
4a. Provided data is incomplete
4a1. Go to 2
4b. All reports were provided
4b1. Go to 6
5a. All reports were provided
5a1. Go to 6
'''
        
    def getUC3(self):
        return '''UC3: Provide a report
Level: User
Main scenario:
1. Student loads initial report form [StudentView]
2. System presents a form for report submission [ReportNew]
3. Student provides report data
4. System validates a data
5. System stores a report
6. System shows list of submitted reports [ReportView]
Exceptions:
4a. Provided data is incomplete
4a1. Go to 3
4b. All reports were provided
4b1. Go to 6
'''
        
    def getUC4(self):
        return '''UC4: View a report
Level: User
Main scenario:
1. Student loads report view [StudentView]
2. System shows the report view with list of available reports [ReportView]
3. Student chooses report for detailed description
4. System show details of chosen report [ReportDetails]
'''
        
    def getUC5(self):
        return '''UC5: Submit a problem
Level: User
Main scenario:
1. Student loads a submit problem view [StudentView]
2. System shows a submit problem view [ProblemNew]
3. Student provides details about a problem
4. System validates data
5. System stores provided data [ProblemView]
Exceptions:
4a. Provided data is incomplete
4a1. Go to 3
'''
        
    def getUC6(self):
        return '''UC6: View a problem
Level: User
Main scenario:
1. Student loads a problem view [StudentView]
2. System shows a problem view with list of problems [ProblemView]
3. Student chooses selected problem
4. System presents details about selected problem [ProblemDetails]
'''
        
    def getUC7(self):
        return '''UC7: View personal data
Level: User
Main scenario:
1. Student loads a personal data view [StudentView]
2. System shows a personal data view [PersonalDataView]
3. Student browse personal data
'''
        
    def getUC8(self):
        return '''UC8: Update personal data
Level: User
Main scenario:
1. Student loads a personal data view [StudetView]
2. System shows a personal data view [PersonalDataView]
3. Student modifies persona data
4. System validates provided data
5. System stores provided data
6. System presents modified data [PersonalDataView]
Exceptions:
4a. Provided data is incomplete
4a1. Go to 3
'''